package crl.menu.utils
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.InteractiveObject;
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class DisplayUtils
	{
		public function DisplayUtils()
		{
		}
		
		
		public static function allMouseEnabled(container:DisplayObjectContainer,bool:Boolean = false,buttList:Array=null) : void
		{
			var i:uint = 0;
			var len:int = container.numChildren;
			var child:DisplayObject;
			while (i < len)
			{
				child=container.getChildAt(i);
				i++;
				
				if(buttList && buttList.indexOf(child)!=-1){
					continue;
				}
				
				if (child is DisplayObjectContainer)
				{
					(child as DisplayObjectContainer).mouseEnabled = bool;
					(child as DisplayObjectContainer).mouseChildren = bool;
				}
					
				else if (child is InteractiveObject)
				{
					(child as InteractiveObject).mouseEnabled = bool;
				}
			
			}
			return;
		}
	}
}